package ar.edu.unq.mongodbexample.model;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;
import com.google.code.morphia.annotations.Reference;

/**
 * Representa una Materia
 * 
 * @author Nicolas Faure
 */
@Entity(value="Subjects",noClassnameStored=true)
public class Subject {

	@Id
    private String name;

    @Reference
    public Course course;

    @Reference
    public ApprovalStrategy approvalStrategy;

    
    public Subject() {

    }
    
    /**
     * Este constructor lo cree  para no utilizar una estrategia de aprobacion por el momento :D
     * @param idName
     */
    public Subject(String idName) {
    	this.setName(idName);
    }

    public Subject(final Course course, final ApprovalStrategy approvalStrategy) {
        this.setCourse(course);
        this.setApprovalStrategy(approvalStrategy);
    }

    public String getName() {
        return this.name;
    }

    public void setName(final String newVal) {
        this.name = newVal;
    }

    public Course getCourse() {
        return this.course;
    }

    public void setCourse(final Course course) {
        this.course = course;
    }

    public ApprovalStrategy getApprovalStrategy() {
        return this.approvalStrategy;
    }

    public void setApprovalStrategy(final ApprovalStrategy approvalStrategy) {
        this.approvalStrategy = approvalStrategy;
    }

}